//
//  SXTMyViewController.m
//  SXT
//
//  Created by 赵金鹏 on 16/8/17.
//  Copyright © 2016年 赵金鹏. All rights reserved.
//

#import "SXTMyViewController.h"
#import "SXTMyTableViewCell.h"
#import "SXTMyHeadView.h"//我的页面顶部注册登陆view
#import "SXTMyTableView.h"//我的功能列表
#import "SXTLandingViewController.h"//注册页面
#import <Masonry.h>
@interface SXTMyViewController ()
@property (strong, nonatomic)   SXTMyHeadView *headView;              /** 顶部现实注册登录按钮的view */

@property (strong, nonatomic)   SXTMyTableView *myTableView;              /** 我的功能模块 */
@end

@implementation SXTMyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = MainColor;
    self.edgesForExtendedLayout = 0;
    [self.view addSubview:self.headView];
    
    [self.view addSubview:self.myTableView];
    __weak typeof (self) weakSelf = self;
    [_headView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.equalTo(weakSelf.view);
        make.height.equalTo(@125);
    }];
    
    [_myTableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(weakSelf.view);
        make.top.equalTo(weakSelf.headView.mas_bottom).offset(35);
    }];
}

- (SXTMyHeadView *)headView{
    if (!_headView) {
        _headView = [[SXTMyHeadView alloc]init];
        __weak typeof (self) weakSelf = self;
        _headView.landingBlock = ^(){
            SXTLandingViewController *landingView = [[SXTLandingViewController alloc]init];
            [weakSelf.navigationController pushViewController:landingView animated:YES];
        };
    }
    return _headView;
}

- (SXTMyTableView *)myTableView{
    if (!_myTableView) {
        _myTableView = [[SXTMyTableView alloc]initWithFrame:CGRectMake(0, 0, 0, 0) style:(UITableViewStylePlain)];
    }
    return _myTableView;
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
